package tema10.persistence;

public class ContactoPersistFactory {
    
    /**
     * @param persistenceMechanism puede ser jdbc o pool
     * @return ContactoDAO si todo va bien, sino null
     */
    public static ContactoDAO getContactoDAO(String persistenceMechanism){
        if(persistenceMechanism.equals("jdbc")){
            return ContactoDAOJDBCImplementation.getContactoDAOJDBCImplementation();
        }
        else if (persistenceMechanism.equals("pool")) {
            return ContactoDAOPoolImplementation.getContactoDAOPoolImplementation();
        }
        else {
            return null;
        }
    }

}
